# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=diskonaut
pkgver=0.11.0
pkgrel=2
pkgdesc="TUI disk space navigator written in rust"
arch=('loong64' 'x86_64')
url="https://github.com/imsnif/diskonaut"
license=('MIT')
makedepends=('cargo')
source=(https://github.com/imsnif/${pkgname}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
b2sums=('20d4fbd713c82dd19901574361d80161e717eaefcf4568a9b1b52723f235b94999dc1579ad37461013661de7be569e7608a0c63de576bf9fa59d6d897f725aa6')

prepare() {
  cd "${pkgname}-${pkgver}"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd ${pkgname}-${pkgver}
  cargo build --frozen --release
}

check() {
  cd ${pkgname}-${pkgver}
  cargo test --frozen
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm 755 target/release/${pkgname} "${pkgdir}/usr/bin/${pkgname}"

  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
